package com.yeban.javase.day03.test02;

/**
 * @Desc TODO
 * @Author yeban
 * @Date 2025/10/11
 */
public class Manager extends Employee{

    private double bonus;

    public Manager(String name, int num, double pay, double bonus) {
        super(name, num, pay);
        this.bonus = bonus;
    }

    public Manager() {
    }

    public Manager(double bonus) {
        this.bonus = bonus;
    }

    public void addSalary(double salary) {
        setPay(getPay() + salary);
    }

    /**
     * 获取
     * @return bonus
     */
    public double getBonus() {
        return bonus;
    }

    /**
     * 设置
     * @param bonus
     */
    public void setBonus(double bonus) {
        this.bonus = bonus;
    }

    @Override
    public String toString() {
        return "Manager{" +
                "name='" + getName() + '\'' +
                ", num=" + getNum() +
                ", pay=" + getPay() +
                ", bonus=" + bonus +
                '}';
    }
}
